package 力扣日常刷题.木22二月.第14天220;

/**
 * @author 帅小伙
 * @date 2022/2/20
 * @description
 */
public class Demo122反转字符串中的单词3 {

    public String reverseWords(String s) {
        s.trim();
        String[] strings = s.split(" ");
        StringBuilder ans = new StringBuilder();
        for (String string : strings) {
            ans.append(new StringBuilder(string).reverse()+" ");
        }
        return ans.toString().trim();
    }

}
